<template>
  <div class="form-home-bar">
    <div class="bar-left">
      <a-breadcrumb>
        <a-breadcrumb-item>应用管理</a-breadcrumb-item>
        <a-breadcrumb-item>{{ curSchemaName }}</a-breadcrumb-item>
      </a-breadcrumb>
    </div>
    <div class="bar-right">
      <a-space :size="8">
        <!-- <rb-icon-button type="icon-luoshu-refresh" /> -->
        <rb-icon-button @click="onEdit" type="icon-luoshu-edit" />
      </a-space>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue';
import { useStore } from 'vuex';

export default defineComponent({
  name: 'FormHomeBar',
  setup() {
    const store = useStore();
    const curSchemaCode = computed(() => store.state.formHome.curSchemaCode);
    const curSchemaName = computed(() => store.state.formHome.curSchemaName);
    const onEdit = () => {
      window.open(`/#/formDesign?schemaCode=${curSchemaCode.value}`);
    };

    return {
      onEdit,
      curSchemaName,
    };
  },
});
</script>

<style lang="less" scoped>
.form-home-bar {
  .flexRow();
  padding: 0 8px;
  height: 44px;
  line-height: 44px;
  background-color: @rb-body-background;
  border-bottom: 1px solid @rb-border-color-base;
}
</style>
